{$head_meta}
<title>{$action} | {$Think.config.title}</title>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
    <!-- BEGIN HEADER -->
    <div class="header navbar navbar-inverse navbar-fixed-top">
        <!-- BEGIN TOP NAVIGATION BAR -->
        <div class="navbar-inner">
            <div class="container-fluid">
                <!-- BEGIN LOGO -->
                <a class="brand" href="{:U('Admin/Index/index')}">
                <img src="__PUBLIC__/admin/assets/img/logo.png" alt="logo" />
                </a>
                <!-- END LOGO -->
                <!-- BEGIN RESPONSIVE MENU TOGGLER -->
                <a href="javascript:;" class="btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse">
                <img src="__PUBLIC__/admin/assets/img/menu-toggler.png" alt="" />
                </a>          
                <!-- END RESPONSIVE MENU TOGGLER -->            
                <!-- BEGIN TOP NAVIGATION MENU -->              
                <ul class="nav pull-right">
                    <!-- BEGIN USER LOGIN DROPDOWN -->
                    <li class="dropdown user">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <img alt="" src="__PUBLIC__/admin/assets/img/avatar1_small.jpg" />
                        <span class="username">{$username}</span>
                        <i class="icon-angle-down"></i>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="{:U('Admin/Index/index')}"><i class="icon-user"></i>个人信息</a></li>
                            <li class="divider"></li>
                            <li><a href="{:U('Admin/Login/logout')}"><i class="icon-key"></i>退出</a></li>
                        </ul>
                    </li>
                    <!-- END USER LOGIN DROPDOWN -->
                </ul>
                <!-- END TOP NAVIGATION MENU --> 
            </div>
        </div>
        <!-- END TOP NAVIGATION BAR -->
    </div>
    <!-- END HEADER -->
    <!-- BEGIN CONTAINER -->
    <div class="page-container row-fluid">
        <!-- BEGIN SIDEBAR -->
        <div class="page-sidebar nav-collapse collapse">
            <!-- BEGIN SIDEBAR MENU -->        
            <ul class="page-sidebar-menu">
                <li>
                    <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                    <div class="sidebar-toggler hidden-phone"></div>
                    <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                </li>
                {$menu}
            </ul>
            <!-- END SIDEBAR MENU -->
        </div>
        <!-- END SIDEBAR -->
        <!-- BEGIN PAGE -->
        <div class="page-content">
            <!-- BEGIN PAGE CONTAINER-->        
            <div class="container-fluid">
                <!-- BEGIN PAGE HEADER-->
                <div class="row-fluid">
                    <div class="span12">  
                        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                        <h3 class="page-title">
                            {$action}<small>&nbsp;&nbsp;{$Think.config.title}</small>
                        </h3>
                        <ul class="breadcrumb">
                            <li>
                                <a href="{$module_url}">{$module}</a>
                                <i class="icon-angle-right"></i>
                            </li>
                            <li><a href="{$action_url}">{$action}</a></li>
                        </ul>
                        <!-- END PAGE TITLE & BREADCRUMB-->
                    </div>
                </div>
                <!-- END PAGE HEADER-->
                <!-- BEGIN PAGE CONTENT-->
                <div class="row-fluid">
                    <div class="span12">
                        <h4>{$action}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="control-group success" style="font-size:16px;color: red;text-align: left; display:none;"></span></h4>
                        
                        <!-- BEGIN EXAMPLE TABLE PORTLET-->
                   
                           <table class="table table-striped table-bordered table-hover">
                        <thead>
                            <tr>
                                <td>序号</td>
                                <td>节点结构  <b title="单击分类隐藏/显示该分类下在子类">[i]</b></td>
                                <td>节点ID</td>
                                <td>名称</td>
                                <td>显示名</td>
                                <td>排序名称</td>
                                <td>类型</td>
                                <td>状态</td>
                                <td width="150">操作</td>
                            </tr>
                        </thead>
                        <volist name="node" id="vo" key="k">
                            <tr align="center" id="{$vo.id}" pid="{$vo.pid}">
                                <td>{$k}</td>
                                <td align="left" class="tree" style="cursor: pointer;">{$vo.fullname}</td>
                                <td>{$vo.id}</td>
                                <td>{$vo.name}</td>
                                <td>{$vo.title}</td>
                                <td edit="0" fd="sort">{$vo.sort}</td>
                                <td>{$vo.level}</td>
                                <td>{$vo.statusTxt}</td>
                                <td>[ <a href="javascript:void(0);" class="opStatus" val="{$vo.status}">{$vo.chStatusTxt}</a> ] [ <a href="__URL__/editNode?id={$vo.id}" class="edit">编辑</a> ]</td>
                            </tr>
                        </volist>
                    </table>

                        <!-- END EXAMPLE TABLE PORTLET-->
                    </div>
                </div>
                <!-- END PAGE CONTENT-->
            </div>
            <!-- END PAGE CONTAINER-->
        </div>
        <!-- END PAGE -->
    </div>
    <!-- END CONTAINER -->
    {$footer}
    {$foot_js}  
    <script>
        jQuery(document).ready(function() {      
            App.init();

            //快捷启用禁用操作
            $(".opStatus").click(function(){
                var obj=$(this);
                var id=$(this).parents("tr").attr("id");
                var status=$(this).attr("val");
                var div = $(".success");
                var url = "{:U('Admin/Access/opNodeStatus')}";
                $.getJSON(url, { id:id, status:status }, function(json){
                    if(json.status==1){
                        div.fadeIn().html(json.info);
                        div.fadeOut(3000);
                        $(obj).attr("val",json.data.status).html(status==1?"启用":"禁用").parents("td").prev().html(status==1?"禁用":"启用");
                    }else{
                        div.fadeIn().html(json.info);
                        div.fadeOut(3000);
                    }
                });
            });
            
            var chn=function(cid,op){
                if(op=="show"){
                    $("tr[pid='"+cid+"']").each(function(){
                        $(this).removeAttr("status").show();
                        chn($(this).attr("id"),"show");
                    });
                }else{
                    $("tr[pid='"+cid+"']").each(function(){
                        $(this).attr("status",1).hide();
                        chn($(this).attr("id"),"hide");
                    });
                }
            }

            //快捷改变操作排序dblclick
            $("tbody>tr>td[fd]").click(function(){
                var inval = $(this).html();
                var infd = $(this).attr("fd");
                var inid =  $(this).parents("tr").attr("id");
                if($(this).attr('edit')==0){
                    $(this).attr('edit','1').html("<input class='input' size='5' id='edit_"+infd+"_"+inid+"' value='"+inval+"' />").find("input").select();
                }
                $("#edit_"+infd+"_"+inid).focus().bind("blur",function(){
                    var editval = $(this).val();
                    $(this).parents("td").html(editval).attr('edit','0');
                    if(inval!=editval){
                        $.post("__URL__/opSort",{id:inid,fd:infd,sort:editval});
                    }
                })
            });
            
            $(".tree").click(function(){
                if($(this).attr("status")!=1){
                    chn($(this).parent().attr("id"),"hide");
                    $(this).attr("status",1);
                }else{
                    chn($(this).parent().attr("id"),"show");
                    $(this).removeAttr("status");
                }
            });
        });
    </script>
</body>
<!-- END BODY -->
</html>